package cn.itqiqi.student_system_java.controller;

import cn.hutool.json.JSONUtil;
import cn.itqiqi.student_system_java.pojo.Student;
import cn.itqiqi.student_system_java.service.impl.StudentServiceImpl;
import cn.itqiqi.student_system_java.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kevin_琪琪
 * @version 1.0
 * @description
 * @date 2022-06-19 16:03
 */
@RestController
public class StudentController {

    @Autowired
    private StudentServiceImpl studentService;

    @PostMapping("/addStu")
    public String addStu(@RequestBody String student) {
        return studentService.insertStu(student);
    }

    @PostMapping("/updateStu")
    public String updateStu(@RequestBody String student) {
        return studentService.updateStu(student);
    }

    @PostMapping("/deleteStu")
    public String deleteStu(@RequestBody String student) {
        return studentService.deleteStu(student);
    }

}
